'use client'

import { Button, Result } from 'antd'
import Link from 'next/link'

export default function NotFound() {
    const handleGoBack = () => {
        if (typeof window !== 'undefined') {
            window.history.back()
        }
    }

    return (
        <div className="min-h-screen flex items-center justify-center bg-gray-50">
            <Result
                status="404"
                title="404"
                subTitle="抱歉，您访问的页面不存在。"
                extra={
                    <div className="space-x-4">
                        <Link href="/">
                            <Button type="primary">
                                返回首页
                            </Button>
                        </Link>
                        <Button onClick={handleGoBack}>
                            返回上一页
                        </Button>
                    </div>
                }
            />
        </div>
    )
}